<%
    var j = 0; // Used to store output entry count
for(var i = 0;i < arrArticle.length && j < theCache.settings["articlePerPageNormal"];i++){
        var tArticle = arrArticle[i];
if(!tArticle.category || !tArticle.category.hidden || (tArticle.category.hidden && theUser.rights["view"] > 1)){
    j++; // Only increase when the article is out
%>
<div class="textbox">
    <div class="textbox-title">
        <h4>
            <% if(tArticle.selected){ %>
                <img src="/public/<%= theCache.settings["imageFolder"] %>/icon_star.gif" alt="<%= __('selected') %>"/>
            <% } %>
            <% if(tArticle.locked || (tArticle.category && tArticle.category.locked)){ %>
                <img src="/public/<%= theCache.settings["imageFolder"] %>/icon_lock.gif" alt="<%= __('locked') %>"/>
            <% } %>
            <a href="article.asp?id=<%= tArticle.id %>">
                <% if(!theUser.checkViewPermission(tArticle)){ %>
                    <%= "["+__('hidden')+"]" %>
                <% }else{ %>
                    <%
                        var strTitle = helper.HTMLEncode(tArticle.title);
                        if (arrKeywords.length > 0) {
                            strTitle = helper.highlight(strTitle, arrKeywords);
                        }
                    %>
                    <%= strTitle %>
                <% } %>
            </a>
            <% if(tArticle.mode > 1){ %>
                <span class="comment-text">[<%= theCache.articleMode[tArticle.mode] %>]</span>
            <% } %>
        </h4>
        <div class="textbox-label">[ <%= helper.getDateTimeString("YY-MM-DD hh:ii:ss", tArticle.postTime) %>
            | <%= __('author') %>: <a
                    href="user.asp?act=view&amp;id=<%= tArticle.authorID %>"><%= tArticle.author %></a>
            <% if(theUser.groupID == 1){ %>
                | <%= tArticle.IP %>
            <% } %>
            ]
        </div>
    </div>
    <div class="textbox-content">
        <% if(!theUser.checkViewPermission(tArticle)){ %>
            <div class="hidden-note"><%= __('no_rights_view') %></div>
        <% }else{ %>
            <%
                var strContent = "";
                if (tArticle.ubbFlags == "html") {
                    strContent = helper.closeHTML(tArticle.content0);
                } else {
                    strContent = ubb.toHTML(helper.closeUBB(helper.HTMLEncode(tArticle.content0)), tArticle.ubbFlags);
                }
                if (arrKeywords.length > 0) {
                    strContent = helper.highlight(strContent, arrKeywords);
                }
            %>
            <%= strContent %>
            <% if(tArticle.content1.length > 1){ %>...<br/><br/><a
                    href="article.asp?id=<%= tArticle.id %>"><b><%= __('read_more') %></b></a><% } %>
        <% } %>
    </div>
    <div class="textbox-bottom">
        <% if(theUser.rights["edit"] > 1 || (theUser.rights["edit"] == 1 && theUser.username == tArticle.author)){ %>
            <a href="article.asp?act=edit&amp;id=<%= tArticle.id %>" title="<%= lang['edit'] %>"><img
                        src="/public/<%= theCache.settings["imageFolder"] %>/icon_edit.gif" alt="<%= lang['edit'] %>"/></a> |
        <% } %>
        <% if(theUser.rights["delete"] > 1 ||
                (theUser.rights["delete"] == 1 && theUser.username == tArticle.author)){ %>
            <a href="article.asp?act=delete&amp;id=<%= tArticle.id %>" title="<%= lang['delete'] %>"
               onclick="return confirm('<%= __('confirm_delete_article') %>?')"><img
                        src="/public/<%= theCache.settings["imageFolder"] %>/icon_del.gif" alt="<%= lang['delete'] %>"/></a> |
        <% } %>
        <a href="?cat=<%= tArticle.category ? tArticle.category.id : 0 %>"><%= __('category') %>: <%= tArticle.category ? tArticle.category.name : '-' %></a> |
        <a href="<%= theCache.settings["baseURL"] %>?id=<%= tArticle.id %>"><%= __('permalink') %></a> |
        <a href="article.asp?id=<%= tArticle.id %>#commentbox"><%= __('comments') %>: <%= tArticle.commentCount %></a>
        |
        <a href="trackback.asp?act=list&amp;id=<%= tArticle.id %>"><%= __('trackbacks') %>
            : <%= tArticle.trackbackCount %></a> |
        <%= __('views') %>: <%= tArticle.viewCount %>
    </div>
</div>

<% } } %>
